<?php 
$data['latitude'] = $_POST['latitude'];
$data['longitude'] = $_POST['longitude'];
$data['radius'] = $_POST['accuracy'];
$data['speed'] = $_POST['speed'];
$info  = add($data);
function add($data = []){
	$url = 'http://yingyan.baidu.com/api/v3/track/addpoint';
	$curl = curl_init();
	$data['ak'] = 'PfIOOKtAPpf91ksRfecNyGzQsCa9h2jy';
    $data['service_id'] = '203049';
    $data['entity_name'] = '杨柳_200';
	$data['loc_time'] = time();
	$data['coord_type_input'] = 'wgs84';
	curl_setopt ($curl, CURLOPT_URL, $url);  
    curl_setopt ($curl, CURLOPT_REFERER, "http://oa.fc62.com/");  
	curl_setopt($curl, CURLOPT_HEADER, 0 ); // 过滤HTTP头
	curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);// 显示输出结果
	curl_setopt($curl,CURLOPT_POST,true); // post传输数据
	curl_setopt($curl,CURLOPT_POSTFIELDS,$data);// post传输数据
	$output = curl_exec($curl);
	//var_dump( curl_error($curl) );//如果执行curl过程中出现异常，可打开此开关，以便查看异常内容
	curl_close($curl);
	return json_decode($output,true);
}
print_R($info);die;
/*116.339303
39.917591

116.36
39.951671

116.517527
39.921576*/
?>


